﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace GameField
{
    class Drawer
    {
       

        public void DrawGameNode(GameNode gameNode)
        {
            Console.SetCursorPosition(gameNode.X, gameNode.Y);
         
            Console.Write(gameNode.NodeSymbol);
            Thread.Sleep(50);

        }
        public void ClearGameNode(GameNode gameNode)
        {
            Console.SetCursorPosition(gameNode.X, gameNode.Y);
            Console.Write(" ");
            Thread.Sleep(50);
        }

        public void DrawGameField(GameField gf, char ch)
        {
            Console.ForegroundColor = ConsoleColor.Blue;
            for (int i = 0; i < gf.Width + 2; i++)
            {
                for (int j = 0; j < gf.Height + 2; j++)
                {
                    Console.SetCursorPosition(i + gf.GameFieldX - 1, j + gf.GameFieldY - 1);
                    if (i == 0 || i == gf.Width + 1)
                    {

                        Console.Write(ch);
                    }
                    else if (j == 0 || j == gf.Height + 1)
                    {
                        Console.Write(ch);
                    }
                    else
                    {
                        Console.Write(' ');
                    }
                }

                Console.WriteLine();
            }
            Console.ForegroundColor = ConsoleColor.White;
        }

        


        }





    }